Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

decamelize

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decamelize

Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32M
decreased by-0.75%
Maintainers
1
Weekly downloads
 
Created

What is decamelize?

The decamelize npm package is used to convert a string from camelCase to a lower case string with a custom separator (defaulting to an underscore). It is useful for transforming variable names or keys in objects from camelCase to a format that is more common in other languages or contexts, such as snake_case for database fields or kebab-case for CSS class names.

What are decamelize's main functionalities?

Decamelize a string

Converts 'myCamelCaseString' to 'my_camel_case_string' using the default separator.

"myCamelCaseString".decamelize()

Decamelize with a custom separator

Converts 'myCamelCaseString' to 'my-camel-case-string' using a custom separator ('-').

"myCamelCaseString".decamelize('-')

Preserve consecutive uppercase characters

Converts 'myURLString' to 'my_url_string', preserving the consecutive uppercase characters.

"myURLString".decamelize('_', { preserveConsecutiveUppercase: true })

Other packages similar to decamelize

Keywords

FAQs

Package last updated on 01 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc